<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
if (!defined("Lotto_lib_include")){
	define("Lotto_lib_include", 1);

/**
 * 取得 Lotto 下注參數
 * @param	intLID Lotto 種類序號
 * @param	intLType 號碼種類
 * @return	回傳 Array[x][y] -> 成功，false 失敗
 * x -> 下注種類序號，y -> 參數名稱，value -> 參數值
 */
	function GetArrayBetParam($intLID, $intLType){
		global $_Conn, $$_Conn;

		$arrBP = array();
		$arrPreBP = array();
		//找出預設的參數值
		/*$strSQL = "select ID as Bet_Type, preOdds, maxOdds, MaxStakeGap, StakeJump, StakeJumpRate, MinStake, MaxPayOff, Com_BetLimit from `bet_BetType` where LType = ".$intLType;
		//print $strSQL;
		if(!$RS = PMA_mysql_query($strSQL, $$_Conn)){
			$GLOBALS["errormessage"] = "Find Bet Param Data Error!!";
			$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($$_Conn)."\nLine:".__LINE__."\nPage:".__FILE__;
			return false;
		}
		while($Rows = PMA_mysql_fetch_object($RS)){
			$arrPreBP[$Rows -> Bet_Type]["preOdds"] = $Rows -> preOdds;
			$arrPreBP[$Rows -> Bet_Type]["maxOdds"] = $Rows -> maxOdds;
			$arrPreBP[$Rows -> Bet_Type]["MaxStakeGap"] = $Rows -> MaxStakeGap;
			$arrPreBP[$Rows -> Bet_Type]["StakeJump"] = $Rows -> StakeJump;
			$arrPreBP[$Rows -> Bet_Type]["StakeJumpRate"] = $Rows -> StakeJumpRate;
			$arrPreBP[$Rows -> Bet_Type]["MinStake"] = $Rows -> MinStake;
			$arrPreBP[$Rows -> Bet_Type]["MaxPayOff"] = $Rows -> MaxPayOff;
			$arrPreBP[$Rows -> Bet_Type]["Com_BetLimit"] = $Rows -> Com_BetLimit;
			$arrBP[$Rows -> Bet_Type]["preOdds"] = 0;
			$arrBP[$Rows -> Bet_Type]["maxOdds"] = 0;
			$arrBP[$Rows -> Bet_Type]["MaxStakeGap"] = 0;
			$arrBP[$Rows -> Bet_Type]["StakeJump"] = 0;
			$arrBP[$Rows -> Bet_Type]["StakeJumpRate"] = 0;
			$arrBP[$Rows -> Bet_Type]["MinStake"] = 0;
			$arrBP[$Rows -> Bet_Type]["MaxPayOff"] = 0;
			$arrBP[$Rows -> Bet_Type]["Com_BetLimit"] = 0;
			$arrBP[$Rows -> Bet_Type]["isAutoSupple"] = 0;
			$arrBP[$Rows -> Bet_Type]["AutoSuppleOverGold"] = 0;
		}*/

		//找出下注參數
		$strSQL = "select Bet_Type, ApointNum, preOdds, maxOdds, MaxStakeGap, StakeJump, StakeJumpRate, PayOffJump, PayOffJumpRate, StakeJump1, MinStake, MaxPayOff, Com_BetLimit, isAutoSupple, AutoSuppleOverGold from `bet_LottoBetParam` where LottoID = ".$intLID;
		if(!$RS = PMA_mysql_query($strSQL, $$_Conn)){
			$GLOBALS["errormessage"] = "Find Bet Param Data Error!!";
			$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($$_Conn)."\nLine:".__LINE__."\nPage:".__FILE__;
			return false;
		}

		//若找不到下注參數，即找出預設的參數值
		if(PMA_mysql_num_rows($RS) == 0){
			$arrBP = $arrPreBP;
		}else{
			while($Rows = PMA_mysql_fetch_object($RS)){
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["preOdds"] = $Rows -> preOdds;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["maxOdds"] = $Rows -> maxOdds;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["MaxStakeGap"] = $Rows -> MaxStakeGap;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["StakeJump"] = $Rows -> StakeJump;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["StakeJumpRate"] = $Rows -> StakeJumpRate;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["PayOffJump"] = $Rows -> PayOffJump;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["PayOffJumpRate"] = $Rows -> PayOffJumpRate;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["StakeJump1"] = $Rows -> StakeJump1;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["MinStake"] = $Rows -> MinStake;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["MaxPayOff"] = $Rows -> MaxPayOff;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["Com_BetLimit"] = $Rows -> Com_BetLimit;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["isAutoSupple"] = $Rows -> isAutoSupple;
				$arrBP[$Rows -> Bet_Type][$Rows -> ApointNum]["AutoSuppleOverGold"] = $Rows -> AutoSuppleOverGold;
			}
		}
		return $arrBP;
	}  //  GetArrayBetParam  //


/**
 * 更改 Lotto 下注參數
 * @param	intLID Lotto 種類序號
 * @param	arrBP[x][y] 下注參數陣列，x -> 下注種類序號，y -> 參數名稱，value -> 參數值
 * @return	回傳 true -> 成功，false 失敗
 */
	function UpdateArrayBetParam($intLID, $arrBP){
		global $_ConnMaster;
		if(!is_array($arrBP)){
			$GLOBALS["errormessage"] = "Bet Param Data 1 not Array!!";
			$GLOBALS["errorhidden"] = "Line:".__LINE__."\nPage:".__FILE__;
			return false;
		}elseif(!is_int($intLID*1)){
			$GLOBALS["errormessage"] = "Lotto Serie No Data not Int!!";
			$GLOBALS["errorhidden"] = "Line:".__LINE__."\nPage:".__FILE__;
			return false;
		}
		$strLog .= "\nLottoID = ".$intLID."： \n";

		foreach($arrBP as $k1 => $v1){
			$intBT = (int)$k1;

			if(!is_array($v1)){
				$GLOBALS["errormessage"] = "Bet Param Data 2 not Array!!";
				$GLOBALS["errorhidden"] = "Line:".__LINE__."\nPage:".__FILE__;
				return false;
			}

			foreach($v1 as $k2 => $v2){
				$intApointNum = (int)$k2;
				$arrUpdate = array();
				$arrInsertF = array();
				$arrInsertV = array();
				$arrLog = array();
				foreach($v2 as $k3 => $v3){
					$arrUpdate[] = $k3." = VALUES(`".$k3."`)";
					$arrInsertF[] = $k3;
					$arrInsertV[] = "'".$v3."'";
					$arrLog[] = $k3." = ".$v3;
				}
				$strLog .= "Bet_Type = ".$intBT.", ".join(", ", $arrLog)."\n";

				$strSQL = "insert into `bet_LottoBetParam`(LottoID, Bet_Type, ApointNum, ".join(",", $arrInsertF).") values(".$intLID.", ".$intBT.", ".$intApointNum.", ".join(",", $arrInsertV).") ON DUPLICATE KEY UPDATE ".join(", ", $arrUpdate);
				if(!PMA_mysql_query($strSQL, $_ConnMaster)){
					$GLOBALS["errormessage"] = "Insert Bet Param Data Error!!";
					$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($_ConnMaster)."\nLine:".__LINE__."\nPage:".__FILE__;
					@mysql_free_result($RS);
					return false;
				}
			} //  foreach($v1 as $k2 => $v2){
		}  //  foreach($arrBP as $k1 => $v1)  //

		AddData_Log("","更改 Lotto 下注參數", $strLog);
		return true;
	}  //  UpdateArrayBetParam  //


/**
 * 產生 Lotto 下注參數，檔案
 * @param	intLID Lotto 種類序號
 * @param	arrBP[x][y] 下注參數陣列，x -> 下注種類序號，y -> 參數名稱，value -> 參數值
 * @return	回傳 true -> 成功，false 失敗
 */
	function MakeBetParamFile($intLID, $arrBP){
		$arrCon = array();
		foreach($arrBP as $intBT => $arrAN){
			foreach($arrAN as $intAN => $arrParam){
				foreach($arrParam as $strPName => $strParam){
					if($strPName == "preOdds")continue;
					$arrCon[] = "$"."_arrBetParam[".$intBT."][".$intAN."][".$strPName."] = ".$strParam.";";
				}
			}
		}

		$strFile = __Common_Path."/betparam/BetParam_".$intLID.".inc.php";
		$strCon = "<"."?php \n".join("\n", $arrCon)."\n?".">";
		if(!writeFile($strFile, $strCon, "w"))return false;

		$arrCon = file($strFile);
		AddData_Log("", "更改 Lotto 下注參數檔案", join("", $arrCon));
		return true;
	}  //  UpdateArrayBetParam  //

/**
 * 產生 Lotto 下注參數，檔案
 * @param	intLID Lotto 種類序號
 * @param	intLType 號碼種類
 * @return	回傳 true -> 成功，false 失敗
 */
	function MakeBetParamFileByLID($intLID, $intLType){
		$arrBP = GetArrayBetParam($intLID, $intLType);
		if($arrBP === false)return false;
		return MakeBetParamFile($intLID, $arrBP);
	}

/**
 * 取得 Lotto 相關資料
 * @param	intLID Lotto 種類序號
 * @return	回傳 Array[x] -> 成功，false 失敗
 * x -> 欄位名稱
 */
	function GetLottoData($intLID){
		global $_Conn, $$_Conn;

		$strSQL = "select * from `bet_Lotto` where ID = ".$intLID;
		if(!$RS = @PMA_mysql_query($strSQL, $$_Conn)){
			$GLOBALS["errormessage"] = "Find Lotto Data Error!!";
			$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($$_Conn)."\nSQL: ".$strSQL."\nLine:".__LINE__."\nPage:".__FILE__;
			return false;
		}

		if(PMA_mysql_num_rows($RS) == 0){
			$GLOBALS["errormessage"] = "Not Find Lotto Data!!";
			$GLOBALS["errorhidden"] = "SQL: ".$strSQL."\nLine:".__LINE__."\nPage:".__FILE__;
			return false;
		}

		return PMA_mysql_fetch_array($RS, MYSQL_ASSOC);
	}  //  GetLottoData  //


/**
 * 產生 Lotto 相關資料檔案
 * @return	回傳 true -> 成功，false 失敗
 * 產生檔案 /common/Lotto.inc.php
 */
	function MakeLottoDataFile(){
		global $_Conn, $$_Conn;

		$strSQL = "select * from `bet_Lotto`";
		if(!$RS = @PMA_mysql_query($strSQL, $$_Conn)){
			$GLOBALS["errormessage"] = "Find Lotto Data Error!!";
			$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($$_Conn)."\nLine:".__LINE__."\nPage:".__FILE__;
			return false;
		}

		while($Rows = PMA_mysql_fetch_array($RS, MYSQL_ASSOC)){
			$arrFName = array();
			while(list($k, $v) = each($Rows)){
				$arrFName[] = "\"".$k."\"=>\"".addslashes($v)."\"";
			}
			$strCon .= "$"."_arrLotto[".$Rows["ID"]."]=array(".join(",", $arrFName).");\n";
		}

		$strCon = "<"."?"."php\n".$strCon."?".">";
		$strFile = __Common_Path."/Lotto.inc.php";
		if(!writeFile($strFile, $strCon, "w"))return false;
		return true;
	}  //  MakeLottoDataFile  //

/**
 * 產生 Lotto 名稱下拉選單
 * @param	arrLotto 樂透陣列，Array[?x][?y] 各種樂透各欄位值，?x -> 樂透序號，?y -> 各欄位值，參閱 bet_Lotto 資料表
 * @param	intLID 樂透序號
 * @param	strSelectName 下拉選單名稱
 * @param	strOnChange 當下拉選單值改變後，要啟動 JavaScript 程式
 * @param	intLang 語言種類序號
 * @return	回傳 String -> 成功，false 失敗
 */
	function MakeLottoSelect($arrLotto, $intLottoID, $strSelectName, $strOnChange, $intLang){
		reset($arrLotto);
		//if(empty($intLottoID))$intLottoID = 1;
		$arrLottoPower = getLottoUsePowerArray();
		$strCon = "<select name=\"".$strSelectName."\" onchange=\"".$strOnChange."\">";
		$strCon .= "<option value=\"\">--select--</option>";
		//while(list($k, $v) = each($arrLotto)){
		foreach($arrLotto as $intLID => $arrL){
			if(!in_array($intLID, $arrLottoPower))continue;

			$strCon .= "<option value=\"".$intLID."\"".(($intLID == $intLottoID)?" selected":"").">".$arrL["Lotto_".$intLang]."</option>";
		}
		$strCon .= "</select>";
		return $strCon;
	}  //  MakeLottoSelect  //

/**
 * 產生 期數 下拉選單
 * @param	intLID 樂透序號
 * @param	strSelectName 下拉選單名稱
 * @param	strOnChange 當下拉選單值改變後，要啟動 JavaScript 程式
 * @param	intNo 展現期數
 * @param	arrLotto 樂透陣列，Array[?x][?y] 各種樂透各欄位值，?x -> 樂透序號，?y -> 各欄位值，參閱 bet_Lotto 資料表
 * @return	回傳 String -> 成功，false 失敗
 */
	function MakeGambleNoSelect($intLID, $intGID, $strSelectName, $strOnChange, $intNo, $arrLotto){
		global $_Conn, $$_Conn, $_intLang;
		if((int)$intNo <= 0)$intNo = 3;

		$strSQL = "select ID, SerialNo, GameDate, LottoID from `bet_Gamble`";
		if(!empty($intLID))$strSQL .= " where LottoID = '".$intLID."'";
		$strSQL .= " order by GameDate desc, SerialNo desc limit 0,".$intNo;

		if(!$RS = @PMA_mysql_query($strSQL, $$_Conn)){
			$GLOBALS["errormessage"] = "Find Gamble Data Error!!";
			$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($$_Conn)."\nLine:".__LINE__."\nPage:".__FILE__;
			print $GLOBALS["errormessage"].$GLOBALS["errorhidden"];
			return false;
		}
		$strCon = "<select name=\"".$strSelectName."\" onchange=\"".$strOnChange."\">";
		$strCon .= "<option value=\"\">--select--</option>";
		if(PMA_mysql_num_rows($RS) > 0){
			while($Rows = PMA_mysql_fetch_object($RS)){
				//$arrTmp = split("-", $Rows -> GameDate);
				$strCon .= "<option value=\"".$Rows -> ID."\"".(($intGID == $Rows -> ID)?" selected":"").">".$Rows -> GameDate." ".sprintf("%03s", $Rows -> SerialNo)." (".$arrLotto[$Rows -> LottoID]["Lotto_".$_intLang].")"."</option>";
			}
		}
		$strCon .= "</select>";
		return $strCon;
	}  //  MakeGambleNoSelect  //

/**
 * 取得 Lotto 生肖陣列參數
 * @param	intLID 樂透序號
 * @return	回傳 Array -> 成功，false 失敗，Array[x] = y，x -> 生肖順序，y -> 號碼值 ex: 11,12....
 */
	function getAnimalsParams($intLID){
		/*global $_Conn, $$_Conn;
		$arrAnimals = array();

		$strSQL = "select `No1InAnimals` from `bet_Lotto` where ID = '".$intLID."'";
		if(!$RS = @PMA_mysql_query($strSQL, $$_Conn)){
			$GLOBALS["errormessage"] = "Find Animals Params Data Error!!";
			$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($$_Conn)."\nLine:".__LINE__."\nPage:".__FILE__;
			return false;
		}

		if(PMA_mysql_num_rows($RS) == 0)return $arrAnimals;

		$Rows = PMA_mysql_fetch_object($RS);
		$arrAN = getAnimalsParamsByNo1($Rows -> No1InAnimals);*/
		$arrAN = getAnimalsParamsByNo1(getNowNo1InAnimals());
		$arrAnimals = array();
		foreach($arrAN as $k => $arrV){
			$arrAnimals[$k] = implode(", ", $arrV);
		}

		return $arrAnimals;
	}  //  getAnimalsParams  //

/**
 * 更改 Lotto 生肖陣列參數
 * @param	intLID 樂透序號
 * @param	arrAnimals 生肖數字定義陣列，Array[x] = y，x -> 生肖順序，y -> 號碼值 ex: 11,12....
 * @return	回傳 true -> 成功，false 失敗
 */
	function setAnimalsParams($intLID, $arrAnimals){
		global $_ConnMaster;

		$strParamValue = addslashes(serialize($arrAnimals));
		$strSQL = "update `bet_Lotto` set AnimalsParam = '".$strParamValue."' where ID = '".$intLID."'";
		if(!PMA_mysql_query($strSQL, $_ConnMaster)){
			$GLOBALS["errormessage"] = "Update Animals Params Data Error!!";
			$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($_ConnMaster)."\nLine:".__LINE__."\nPage:".__FILE__;
			return false;
		}

		$strLogCon = "LID: ".$intLID."\n".$strParamValue;
		AddData_Log("", "更改 Lotto 生肖陣列參數", $strLogCon);

		return MakeAnimalsParamsFile($intLID, $arrAnimals);
		//return true;
	}  //  setAnimalsParams  //

/**
 * 產生 Lotto 生肖陣列參數檔案
 * @param	intLID 樂透序號
 * @param	arrAnimals 生肖數字定義陣列，Array[x] = y，x -> 生肖順序，y -> 號碼值 ex: 11,12....
 * @return	回傳 true -> 成功，false 失敗
 */
	function MakeAnimalsParamsFile($intLID, $arrAnimals){
		if(!is_array($arrAnimals)){
			$arrAnimals = getAnimalsParams($intLID);
			if($arrAnimals === false)return false;
		}

		$strParamValue = addslashes(serialize($arrAnimals));
		$strCon = "<"."?"."php\n\$_arrAnimalsParams = unserialize(\"".$strParamValue."\");\n"."?".">";
		$strFile = __Common_Path."/betparam/AnimalsParams_".$intLID.".inc.php";
		if(!writeFile($strFile, $strCon, "w"))return false;

		//產生 JavaScript 檔
		$strCon = "";
		foreach($arrAnimals as $key => $strAnimals){
			$strCon .= "strAnimals".$key." = \"".$strAnimals."\"";
			$strCon .= ($key != 12)?", ":";";
		}
		if($strCon != "")$strCon = "var ".$strCon;
		$strFile = __Common_Path."/betparam/AnimalsParams_".$intLID.".js";
		if(!writeFile($strFile, $strCon, "w"))return false;
		return true;
	}


/**
 * 依 "1" 號位於不同生肖，取得 Lotto 生肖陣列參數
 * @param	intNo1InAnimals 一號在那個生肖
 * @return	回傳 Array -> 成功，false 失敗，Array[x] = y，x -> 生肖順序，y -> 號碼值 ex: 11,12....
 */
	function getAnimalsParamsByNo1($intNo1InAnimals){
		$arrAnimals = array(
			1 => array("01", "13", "25", "37", "49"),
			2 => array("12", "24", "36", "48"),
			3 => array("11", "23", "35", "47"),
			4 => array("10", "22", "34", "46"),
			5 => array("09", "21", "33", "45"),
			6 => array("08", "20", "32", "44"),
			7 => array("07", "19", "31", "43"),
			8 => array("06", "18", "30", "42"),
			9 => array("05", "17", "29", "41"),
			10 => array("04", "16", "28", "40"),
			11 => array("03", "15", "27", "39"),
			12 => array("02", "14", "26", "38")
		);

		$arrNo1Animals = array();
		for($i = 1; $i <= 12; $i++){
			$j = $intNo1InAnimals + $i - 1;
			if($j > 12)$j -= 12;
			$arrNo1Animals[$j] = $arrAnimals[$i];
		}
		ksort($arrNo1Animals);
		return $arrNo1Animals;
	}  //  getAnimalsParamsByNo1  //


/**
 * 取得目前 "1" 號位於那個生肖
 * @return	回傳 int -> 成功，false 失敗
 */
	function getNowNo1InAnimals(){
		return getDateNo1InAnimals(date("Y-m-d"));
	}  //  getNowNo1InAnimals  //


/**
 * 依日期，取得目前 "1" 號位於那個生肖
 * @return	回傳 int -> 成功，false 失敗
 */
	function getDateNo1InAnimals($strDate){
		$arrDate = array(
									array("2005-02-09", "2006-01-28", "10"),
									array("2006-01-29", "2007-02-17", "11"),
									array("2007-02-18", "2008-02-06", "12"),
									array("2008-02-07", "2009-01-25", "1"),
									array("2009-01-26", "2010-02-13", "2"),
									array("2010-02-14", "2011-02-02", "3"),
									array("2011-02-03", "2012-01-22", "4"),
									array("2012-01-23", "2013-02-09", "5"),
									array("2013-02-10", "2014-01-30", "6"),
									array("2014-01-31", "2015-02-18", "7"),
									array("2015-02-19", "2016-02-07", "8"),
									array("2016-02-08", "2017-01-27", "9"),
									array("2017-01-28", "2018-02-15", "10"),
									array("2018-02-16", "2019-02-24", "11"),
									array("2019-02-25", "2020-01-24", "12"),
									array("2020-01-25", "2010-02-11", "1"),
									array("2021-02-12", "2022-01-31", "2")
							);

		foreach($arrDate as $arrD){
			if($strDate >= $arrD[0] && $strDate <= $arrD[1]){
				return (int)$arrD[2];
			}
		}
		exit("No Date Item!!!");
	}  //  getDateNo1InAnimals  //

/**
 * 依日期，取得 Lotto 生肖陣列參數
 * @param	intLID 樂透序號
 * @param	strDate 日期
 * @return	回傳 Array -> 成功，false 失敗，Array[x] = y，x -> 生肖順序，y -> 號碼值 ex: 11,12....
 */
	function getAnimalsParamsByDate($intLID, $strDate){
		if($intLID != 1)return array();

		return getAnimalsParamsByNo1(getDateNo1InAnimals($strDate));
	}  //  getAnimalsParamsByDate  //

/**
 * 轉換 Lotto 生肖陣列參數，號碼 => 生肖
 * @param	arrAnimals 生肖數字定義陣列，Array[x] = y，x -> 生肖順序，y -> 號碼值 ex: 11,12....
 * @return	回傳 Array -> 成功，false 失敗，Array[x] = y，x -> 號碼值，y -> 生肖
 */
	function getExChangeAnimalsParams($arrAnimals){
		$arrExAnimals = array();
		if(!is_array($arrAnimals))return $arrExAnimals;

		foreach($arrAnimals as $k1 => $arrV){
			if(!is_array($arrV))return$arrExAnimals;

			foreach($arrV as $k2 => $strNum){
				$arrExAnimals[(int)$strNum] = (int)$k1;
			}
		}
		return $arrExAnimals;
	}  //  getAnimalsParamsByDate  //


/**
 * 取得Lotto 種類使用權限陣列
 * @return	回傳 Array -> 成功
 */
	function getLottoUsePowerArray($arrUserGPrower = array()){
		$arrPower = (!defined('__LottoUsePower'))?array(1, 2, 3):explode(",", __LottoUsePower);
		if(__LottoUsePower == "")$arrPower = array(1, 2, 3);

		if(!is_array($arrUserGPrower) || sizeof($arrUserGPrower) == 0)return $arrPower;

		$arrTmp2 = array();
		foreach($arrPower as $intGID){
			if($arrUserGPrower[$intGID] == 1)$arrTmp2[] = $intGID;
		}

		return $arrTmp2;
	}  //  getLottoUsePowerArray  //
//-------------------------------------------------------//
//Lotto_lib End
}
?>